package com.wangcp.controller;

import com.wangcp.service.AsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* 测试线程池
* @author wangcp
* @date 2022/01/17 16:58
**/
@RestController
public class TestExecutorPool {

    @Autowired
    private AsyncService asyncService;

    @GetMapping("/async")
    public void async(){
        for (int i = 0; i < 10; i++) {
            asyncService.executeAsync();
        }
    }

}
